<template>
	<view class="ex-ui-main-page" :class="[proxy.themeClass('page-bg-color')]">
    <view class="container">
      <image class="logo" src="/static/logo.png" />
      <view class="text-area">
        <text class="title">{{ title }}</text>
        <h2>{{ userStore.name }}</h2>
        <h2>{{ userStore.fullName }}</h2>
        <button @click="updateName('sss')">increment</button>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import { useUserStore } from '../../store/user'
import useCurrentInstance from '@/utils/useCurrentInstance'
const userStore = useUserStore()
const { proxy } = useCurrentInstance()
const title = ref('Hello')
// functions
function updateName(str: string) {
  userStore.updateName('sss')
  console.log(proxy)
  proxy.$Router.replaceAll({ name: 'index' })
}
// const props = defineProps({
//   msg: String
// })

// const { title } = toRefs(props)
// console.log(title.value)
</script>

<style>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 200rpx;
  width: 200rpx;
  margin-top: 200rpx;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50rpx;
}

.text-area {
  display: flex;
  justify-content: center;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}
</style>
